<template>
  <div class="bpl1-bg">
    <div class="co-title">
      <div class="co-title-name">
        <img src="@/assets/cockpit/subdivision/co-text-xxgh.png" alt="" />
      </div>
    </div>
    <div class="detail-content">
      <div class="left">
        <div class="com-title-style">
          <div class="title-line">
            <img src="@/assets/cockpit/subdivision/co-title-yellow.png" alt="" />
          </div>
          <div>控制性详细规划</div>
        </div>
        <ul class="detail-num">
          <li>
            <div class="title">
              <div class="icon"></div>
              <div class="name">已立项</div>
            </div>
            <div class="number">33</div>
          </li>
          <li>
            <div class="title">
              <div class="icon"></div>
              <div class="name">已报审</div>
            </div>
            <div class="number">21</div>
          </li>
          <li>
            <div class="title">
              <div class="icon"></div>
              <div class="name">已批复</div>
            </div>
            <div class="number">10</div>
          </li>
          <li>
            <div class="title">
              <div class="icon"></div>
              <div class="name">已入库</div>
            </div>
            <div class="number">8</div>
          </li>
        </ul>
      </div>
      <div class="mid-line"></div>
      <div class="mid">
        <ul class="bpl1-stac">
          <li class="bpl1-st-each">
            <i class="bpl1-ste-icon"><img src="@/assets/cockpit/subdivision/co-icon-ghps.png" alt=""/></i>
            <div class="bpl1-ste-word">
              <h6>控规片数（片）</h6>
              <p>96</p>
            </div>
          </li>
          <li class="bpl1-st-each">
            <i class="bpl1-ste-icon"><img src="@/assets/cockpit/subdivision/co-icon-fgl.png" alt=""/></i>
            <div class="bpl1-ste-word">
              <h6>中心城区覆盖率（百分比）</h6>
              <p>90</p>
            </div>
          </li>
          <li class="bpl1-st-each">
            <i class="bpl1-ste-icon"><img src="@/assets/cockpit/subdivision/co-icon-zmj.png" alt=""/></i>
            <div class="bpl1-ste-word">
              <h6>规划总面积（平方公里）</h6>
              <p>4,321.11</p>
            </div>
          </li>
          <li class="bpl1-st-each">
            <i class="bpl1-ste-icon"><img src="@/assets/cockpit/subdivision/co-icon-zmj.png" alt=""/></i>
            <div class="bpl1-ste-word">
              <h6>规划建设用地总面积（平方公里）</h6>
              <p>2,354.66</p>
            </div>
          </li>
        </ul>
      </div>
      <div class="right-line"></div>
      <div class="right">
        <div class="right-lf">
          <div class="com-title-style">
            <div class="title-line">
              <img src="@/assets/cockpit/subdivision/co-title-blue.png" alt="" />
            </div>
            <div>村庄规划</div>
          </div>
          <ul class="detail-num">
            <li>
              <div class="title">
                <div class="icon"></div>
                <div class="name">已立项</div>
              </div>
              <div class="number">33</div>
            </li>
            <li>
              <div class="title">
                <div class="icon"></div>
                <div class="name">已报审</div>
              </div>
              <div class="number">21</div>
            </li>
            <li>
              <div class="title">
                <div class="icon"></div>
                <div class="name">已批复</div>
              </div>
              <div class="number">10</div>
            </li>
            <li>
              <div class="title">
                <div class="icon"></div>
                <div class="name">已入库</div>
              </div>
              <div class="number">8</div>
            </li>
          </ul>
        </div>
        <div class="right-rg-line"></div>
        <div class="right-rg">
          <div class="village-content" id="village"></div>
        </div>
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { Vue, Component } from 'vue-property-decorator'
import echarts from 'echarts'

@Component({
  name: 'Detailed',
  components: {}
})
export default class Detailed extends Vue {
  mounted() {
    this.initVillage()
  }
  initVillage() {
    const myChart = echarts.init(document.getElementById('village') as HTMLElement)
    myChart.setOption({
      label: {
        color: '#ffffff'
      },
      grid: {
        top: '14%',
        left: '4%',
        right: '4%',
        bottom: '3%',
        containLabel: true
      },
      xAxis: {
        type: 'category',
        data: ['芙蓉区', '开福区', '天心区', '雨花区', '望城区', '长沙县', '浏阳市', '宁乡市'],
        //设置网格线颜色
        splitLine: {
          show: false
        },
        axisLine: {
          lineStyle: {
            color: '#254177'
          }
        },

        axisLabel: {
          show: true,
          textStyle: {
            color: '#ffffff', //更改坐标轴文字颜色
            fontSize: 12 //更改坐标轴文字大小
          }
        }
      },
      yAxis: {
        type: 'value',
        axisLabel: {
          show: true,
          textStyle: {
            color: '#ffffff', //更改坐标轴文字颜色
            fontSize: 12 //更改坐标轴文字大小
          }
        },
        splitLine: {
          show: false,
          lineStyle: {
            color: ['#000000'],
            width: 0,
            type: 'solid'
          }
        },
        // y轴轴线颜色
        axisLine: {
          lineStyle: {
            color: '#254177'
            // width: 1 //这里是坐标轴的宽度
          }
        }
      },
      series: [
        {
          data: [8, 7, 3, 14, 16, 19, 10, 8],
          type: 'bar',
          barWidth: '18%',
          itemStyle: {
            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
              {
                offset: 0,
                color: '#6dffd6'
              },
              {
                offset: 1,
                color: '#00FFAA'
              }
            ])
          },
          showBackground: true,
          backgroundStyle: {
            color: 'rgba(180, 180, 180, 0.2)'
          }
        }
      ]
    })
  }
}
</script>
<style lang="scss" scoped>
@import '~@/styles/cockpit.scss';
.bpl1-bg {
  width: 100%;
  height: 100%;
  padding: 22px 12px 12px 16px;
  background: url('~@/assets/cockpit/bb-bg.png') no-repeat 0/ 100% 100%;
  position: relative;
  display: flex;
  flex-direction: column;

  .co-title {
    flex-shrink: 0;
  }
}

.bpl1-table {
  width: 100%;
  .bpl1-tbe {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0px 2px;
    text-align: center;
    .bpl1-tbeh {
      height: 20px;
      background: rgba(#fff, 0.1);
      th {
        font-size: 12px !important;
        line-height: 18px;
        color: #bffeff;
        font-weight: 400;
      }
    }
    .bpl1-tbeb {
      td {
        padding: 4px 4px;
        background: rgba(#fff, 0.05);
        font-size: 16px !important;
        line-height: 20px;
        color: #fff;
        font-weight: 500;
        > span {
          font-size: 12px !important;
          color: #fff;
          font-weight: 400;
        }
      }
      .bpl1-tbeb-title {
        padding: 0 0 0 2px !important;
        background: none;
        border-left: 2px solid #006aff;
        position: relative;
        > p {
          width: 100%;
          height: 100%;
          padding: 4px;
          background: rgba(#fff, 0.05);
          line-height: 20px;
          text-align: center;
          font-size: 12px !important;
          color: #fff;
          font-weight: 400;
        }
      }
    }
  }
}
.bpl1-stac {
  width: 100%;
  display: flex;
  padding: 32px 0 0 22px;
  flex-wrap: wrap;
  .bpl1-st-each {
    flex: none;
    display: flex;
    width: 50%;
    .bpl1-ste-icon {
      flex: none;
      width: 64px;
      height: 64px;
      > img {
        display: block;
        width: 100%;
        height: 100%;
      }
    }
    .bpl1-ste-word {
      flex: none;
      > h6 {
        font-size: 12px !important;
        line-height: 18px;
        color: #bffeff;
        text-align: left;
        font-weight: 400;
        margin: 6px 0 0 0;
      }
      > p {
        font-size: 24px !important;
        line-height: 30px;
        color: #fff;
        text-align: left;
        font-weight: 500;
        margin: 4px 0 0 0;
      }
    }
    .bpl1-ste-chart {
      flex: none;
      width: 64px;
      height: 64px;
      padding: 2px;
      position: relative;
      margin: 0 0 0 12px;
      .bpl1-ste-chart-base {
        width: 100%;
        height: 100%;
      }
      .bpl1-ste-chart-word {
        width: 80%;
        position: absolute;
        left: 10%;
        top: 50%;
        transform: translate(0, -50%);
        > h6 {
          font-size: 16px !important;
          text-shadow: 0 0 4px #00ffaa;
          color: #fff;
          line-height: 20px;
          text-align: center;
        }
        > p {
          font-size: 12px !important;
          line-height: 14px;
          color: #bffeff;
          text-align: center;
        }
      }
    }
  }
  .bpl1-st-line {
    flex: none;
    width: 1px;
    height: 64px;
    background: rgba(#fff, 0.1);
    margin: 0 4px;
  }
}

.com-title-style {
  margin-top: 12px;
  color: #bffeff;
  display: flex;
  .title-line {
    width: 40px;
    margin-top: -7px;
    img {
      display: block;
      width: 100%;
    }
  }
}

.detail-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: row;
  flex: 1;
  .left {
    width: 166px;
    flex-shrink: 0;
    .detail-num {
      margin-top: 10px;
      li {
        display: flex;
        justify-content: space-between;
        width: 154px;
        height: 29px;
        line-height: 29px;
        background: rgba(255, 255, 255, 0.05);
        margin-bottom: 6px;

        .title {
          display: flex;
          margin-left: 6px;
          .icon {
            width: 4px;
            height: 4px;
            margin-top: 13px;
            margin-right: 6px;
            display: block;
            background: #f9f0d4;
            border-radius: 1px;
            box-shadow: 0 0 4px 1px #f0b04a;
            transform: rotate(45deg);
          }
          .name {
            font-size: 12px;
            color: #bffeff;
          }
        }

        .number {
          font-size: 14px !important;
          text-align: right;
          color: #fff;
          margin-right: 6px;
        }
      }
    }
  }
  .mid-line {
    width: 1px;
    height: 136px;
    background: rgba(255, 255, 255, 0.1);
    margin-left: 14px;
    margin-top: 32px;
    flex-shrink: 0;
  }
  .right-line {
    width: 1px;
    height: 136px;
    background: rgba(255, 255, 255, 0.1);
    margin-left: 14px;
    margin-top: 32px;
    flex-shrink: 0;
  }
  .mid {
    width: 523px;
    overflow: hidden;
    flex-shrink: 0;
  }
  .right-rg-line {
    width: 1px;
    height: 132px;
    background: rgba(255, 255, 255, 0.1);
    margin-left: 14px;
    margin-top: 36px;
    flex-shrink: 0;
  }
  .right {
    display: flex;
    flex: 1;
    .right-lf {
      width: 166px;
      margin-left: 12px;
      flex-shrink: 0;
      .detail-num {
        margin-top: 10px;
        li {
          display: flex;
          justify-content: space-between;
          width: 154px;
          height: 29px;
          line-height: 29px;
          background: rgba(255, 255, 255, 0.05);
          margin-bottom: 6px;

          .title {
            display: flex;
            margin-left: 6px;
            .icon {
              width: 4px;
              height: 4px;
              margin-top: 13px;
              margin-right: 6px;
              display: block;
              background: #00eaff;
              border-radius: 1px;
              box-shadow: 0 0 4px 1px #0095ff;
              transform: rotate(45deg);
            }
            .name {
              font-size: 12px;
              color: #bffeff;
            }
          }

          .number {
            font-size: 14px !important;
            text-align: right;
            color: #fff;
            margin-right: 6px;
          }
        }
      }
    }
    .right-rg {
      width: 100%;
      // height: 220px;
      flex: 1;

      .village-content {
        width: 100%;
        height: 100%;
        // margin-top: -16px;
      }
    }
  }
}
</style>
